package utils
{
	import com.wp.datacontainer.map.HashMap;
	
	import events.MapEvent;
	
	import flash.events.EventDispatcher;
	import flash.ui.Mouse;
	import flash.ui.MouseCursor;

	/**
	 * 全局鼠标状态管理， 用以表明玩家正在做何种操作
	 * wuxi create on 2012-9-12 12:18:33
	 * */
	public class MouseStatusManager extends EventDispatcher
	{
		public function MouseStatusManager()
		{
		}
		/*
		 * 常态 
		*/
		public static const STATUS_NORMAL:int = 0;
		/*
		 * 拖拽地图
		*/
		public static const STATUS_DRAGMAP:int = 1;
		/*
		 * 设置阻挡点
		*/
		public static const STATUS_NOWALK:int = 2;
		/*
		 * 设置半透区域
		*/
		public static const STATUS_HALF:int = 3;
		/*
		 * 清除阻挡点
		*/
		public static const STATUS_CLEARNOWALK:int = 4;
		/*
		* 清除半透区域
		*/
		public static const STATUS_CLEARHALF:int = 5;
		/*
		 * 放置传送点
		*/
		public static const STATUS_SETTRANSPOINT:int = 6;
		/*
		 * 编辑已选传送点的位置信息
		*/
		public static const STATUS_EDITTRANSPOS:int = 7;
		/*
		 * 放置npc
		*/
		public static const STATUS_SETNPC:int = 8;
		/*
		* 编辑npc位置
		*/
		public static const STATUS_EDITTNPC:int = 9;
		/*
		* 放置怪物
		*/
		public static const STATUS_SETMONSTER:int = 10;
		/*
		* 编辑怪物位置
		*/
		public static const STATUS_EDITMONSTER:int = 11;
		/*
		 * 设置人物在本地图的出生点
		*/
		public static const STATUS_SETBORNPOINT:int = 12;
		
		/**
		 * 设置场景中的特效
		 * */
		public static const STATUS_SETEFFECT:int = 13;
		
		private static var _currentStatus:int = 0;
		public static function set currentStatus(param:int):void{
			_currentStatus = param;
			/*if(_currentStatus == STATUS_NORMAL){
				Mouse.cursor = MouseCursor.AUTO;
			}*/
			
			EventManager.getInstance().dispatchEvent(new MapEvent(MapEvent.MOUSESTATUS_CHANGE));
		}
		public static function get currentStatus():int{
			return _currentStatus;
		}
		
		
		public static var statusMap:HashMap = new HashMap();
		init();
		private static function init():void{
			statusMap.put(STATUS_NORMAL,"无");
			statusMap.put(STATUS_DRAGMAP,"拖拽地图");
			statusMap.put(STATUS_NOWALK,"选择不可走点");
			statusMap.put(STATUS_HALF,"选择半透区");
			statusMap.put(STATUS_CLEARNOWALK,"清除不可走点");
			statusMap.put(STATUS_CLEARHALF,"清除半透区");
			statusMap.put(STATUS_SETTRANSPOINT,"设置传送点位置");
			statusMap.put(STATUS_EDITTRANSPOS,"重新选择传送点位置");
			
			statusMap.put(STATUS_SETNPC,"设置Npc位置");
			statusMap.put(STATUS_EDITTNPC,"重新设置Npc位置");
			statusMap.put(STATUS_SETMONSTER,"设置怪物位置");
			statusMap.put(STATUS_EDITMONSTER,"重新设置怪物位置");
			statusMap.put(STATUS_SETBORNPOINT,"设置出生点位置");
			
			statusMap.put(STATUS_SETEFFECT,"设置场景中的特效");
		}
	}
}